package com.zp.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author zp
 * @description 线程池配置类
 * @created 2021/11/25 10:03
 */

@Configuration
public class ExecutorConfig {

    @Bean("renewalSchedulingExecutor")
    public ThreadPoolExecutor renewalSchedulingExecutor(){
        return new ThreadPoolExecutor(10,
                10,0L, TimeUnit.MILLISECONDS,
                new LinkedBlockingDeque<>(),new ThreadPoolExecutor.AbortPolicy());
    }
}
